<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>再搜索垃圾分类查询-用户注册</title>
<link href="<%=path%>/static/css/all.css?322321255" rel="stylesheet" type="text/css">
<!--[if IE]>
<script>
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
</script>
<![endif]-->
</head>
<body>
<header>
<div id="topnav">
    <div class="topnav">
      <ul>
        <li><a href="<%=path%>/web/garbage/index" title="">首页</a></li>
        <li><a href="#" title="">关于我们</a></li>
        <li><a href="graphers.html" title="">开发团队</a></li>
      </ul>
    </div>
  </div>
</header>
<section>
  <div class="wrap">
    <div id="login">
      <div class="login">
        <li class="loginForm">
          <h1>用户登录</h1>
          <form action="<%=path%>/web/userinfo/index" id="user-login" method="post" novalidate="novalidate" >
          <ol>
            <li>
              <label style="margin-top: 7px">用户名：</label>
              <input type="text"  name="username" id="username" class="valid" required aria-invalid="true">
            <label id="name-error" class="error" for="username" style="display: none;"></label></li>
            <li>
              <label style="margin-top: 8px">密码：</label>
              <input type="password" name="password" id="password" class="error" required aria-invalid="true">
              <label id="passsword-error" class="error" for="password" style="display: block;">这是必填字段</label></li>
            <li class="checking"><jsp:include page="/web/userinfo/code"/></li>
              <li class="button">
                  <label></label>
                  <input name="RememberMe" type="checkbox" class="checkbox" id="RememberMe" value="true" data-val="true" data-val-required="记住我? 字段是必需的。">
                  <label for="RememberMe">记住我?</label>
                  <input id="userLogin" disabled type="button" value="登录">
              </li>
            </ol>
          </form>
            <div class="msg" ><a href="<%=path%>/web/userinfo/register" style="margin-left: 10px">立即注册</a><a href="<%=path%>/web/userinfo/findpassword">重置密码</a>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
<footer>
  <div id="footer">
    <div id="footernav"> <a href="#">返回顶部</a> <span>|</span> <a href="#">联系方式</a> <span>|</span> <a href="#">网站地图</a> <span>|</span> <a href="#">版权说明</a> </div>
    <div id="copyright">
      <p>copright qingsoft2013 web设计 <a href="HTTP://www.songshuo.com" target="_blank">宋硕设计网站设计工作室</a></p>
    </div>
  </div>
</footer>
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.3.1.min.js"></script>
<script src="<%=path%>/static/js/layui/layui.all.js"></script>
<script>
  $(function () {
    $("#userLogin").click(function () {
      var username = $.trim($("#username").val());
      var password = $("#password").val();
      var RememberMe = $("#RememberMe").prop("checked");
      if(username.length<1)
      {
        layer.msg("邮箱/手机号不能为空",{icon:5})
        return;
      }

      $.ajax({
          url:"<%=path%>/web/userinfo/login",
          type:"post",
          data:{username:username,password:password,RememberMe:RememberMe},
          async:false,
          success:function (data) {
              if(data=="0")
              {
                 layer.msg("邮箱/手机号或者密码错误")
              }
              else
              {
                  $("#user-login").submit();
              }
          }
      });

    })
  })
</script>
</body>
</html>
